package com.waiting.map;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description
 * @Author bjweitingting
 * @Date 2019/3/12
 **/
public class TestMapHashCode {
    public static void main(String[] args) {
        Map<String, Integer> test = new HashMap<>();
        System.out.println("初始map的hashcode值：" + test.hashCode());
        test.put("abc", 132);
//        System.out.println("abc".hashCode());
        System.out.println("放进一个元素的map的hashcode值：" + test.hashCode());
        test.put("abcd", 100);
//        System.out.println("abcd".hashCode());
        System.out.println("放进两个个元素的map的hashcode值：" + test.hashCode());
        test.keySet();
        test.forEach((k, v) -> {
            System.out.println(k + v);
        });
//        System.out.println(test.keySet());
//        for (String item : test.keySet()) {
//            System.out.println(test.get(item));
//        }
    }
}
